-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test the Dockerfile #3677
Test the Dockerfile #3677
Conversation
350b616
to
8c36d4e
Compare
8c36d4e
to
de40cad
Compare
de40cad
to
bf19cd8
Compare
Note by muxator: This commit introduced a copied & modified version of the testing files loadSettings.js and pad.js. It's Christmas night, and we want to shipt this feature, so I merged it anyway, adding a note in both the original and copied files so that hopefully someone in the distant future is going to merge them back again.
c9506c4
to
456bb4a
Compare
I've missed this. Is this PR still valid? |
456bb4a
to
f53d41d
Compare
Absolutely. I have rebased and it still succeeds. I am thinking of re-enabling backend testing in the CI in a folllow-up. |
Note that frontend tests are still disabled in PRs, and they will continue to run on
|
I feel the urge to clarify:
|
The dependency on java was introduced in 2012 (c021cf5) to start Sauce-Connect from sauce labs. Probably at the time it was a runtime dependency, but it is no longer the case today. It is possible that java was already not needed when db003a1 changed from downloading Sauce-Connect-latest.zip to sc-latest-linux.tar.gz. Moreover, I am quite sure tests/frontend/travis/sauce_tunnel.sh no longer works today, because tests/frontend/travis/sauce_tunnel.sh downloads from an url that gives HTTP/404 now: sc-latest-linux.tar.gz if no longer a valid file name, we would need to explicitly download a specific version.
2263e07
to
16ffc45
Compare
I am having a look at this now, having a look at TravisCI doc in the meantime :) If I get it right, the old 9ef3342 creates a If I understood this correctly, I am going to proceed to split these two passes. BTW, in the process I have seen that the jdk dependency was no longer needed (see 86f64a9), and I am now wondering how the frontend test can work at all, given that there is a command that is guaranteed to fail ( Edit: apparently the failing script was disabled in 2017, and this explains my doubts about |
Note to self: the relevant TravisCI docs for moving under a jobs section is https://docs.travis-ci.com/user/build-matrix/
|
… later In the next commit Pierre will start adding tests for the docker build, and this lays out the structure for doing that. No functional changes. The relevant TravisCI docs that motivates moving under a jobs section is https://docs.travis-ci.com/user/build-matrix/ > There are two ways to specify multiple parallel jobs (what we call the build > matrix) with a single .travis.yml configuration file: > > * combine a language-and-environment dependent set of configuration options to > automatically create a matrix of all possible combinations. This is called > matrix expansion. For example, the following configuration produces a build > matrix that expands to 8 individual (2 * 2 * 2) jobs > [...] > > * specify the exact combination of configurations you want in jobs.include. > For example, if not all of those combinations are interesting, you can > specify just the combinations you want
Add a `Test Dockerfile` job to Travis that checks the `docker build` exit code. More useful tests can be added later.
LGTM |
In the following commits Pierre is going to copy & modify some files. This commit prepares the source files in order to minimize those differences, so we can re-unify them as soon as possible. No functional changes.
This is just needed to slim up the diffs for the next commits. Non functional changes.
The last commit in this series ("ci: test basic application response of the docker build", 13d9e86) copies & modifies two settings files. It's Christmas night and this feature merits to be shipped, so let's go with it. As minimum measure, I have rewritten the commit history to make explicit which files were copied and minimize the differences.
--- backend/loadSettings.js 2019-12-25 00:09:53.368516235 +0100
+++ container/loadSettings.js 2019-12-25 00:09:53.372516247 +0100
@@ -9,13 +9,17 @@
const fs = require('fs');
function loadSettings(){
- var settingsStr = fs.readFileSync(__dirname+"/../../settings.json").toString();
+ var settingsStr = fs.readFileSync(__dirname+"/../../settings.json.docker").toString();
// try to parse the settings
try {
if(settingsStr) {
settingsStr = jsonminify(settingsStr).replace(",]","]").replace(",}","}");
var settings = JSON.parse(settingsStr);
+ // custom settings for running in a container
+ settings.ip = 'localhost';
+ settings.port = '9001';
+
return settings;
}
}catch(e){
--- backend/specs/api/pad.js 2019-12-25 00:09:53.368516235 +0100
+++ container/specs/api/pad.js 2019-12-25 00:09:53.372516247 +0100
@@ -47,7 +23,6 @@
it('finds the version tag', function(done) {
api.get('/api/')
.expect(function(res){
- apiVersion = res.body.currentVersion;
if (!res.body.currentVersion) throw new Error("No version set in API");
return;
})
@@ -57,592 +32,7 @@
describe('Permission', function(){
it('errors with invalid APIKey', function(done) {
- // This is broken because Etherpad doesn't handle HTTP codes properly see #2343
- // If your APIKey is password you deserve to fail all tests anyway
- var permErrorURL = '/api/'+apiVersion+'/createPad?apikey=password&padID=test';
- api.get(permErrorURL)
+ api.get('/api/'+apiVersion+'/createPad?apikey=wrong_password&padID=test')
.expect(401, done)
});
}) I will open an issue in Etherpad to remember to get rid of this duplication asap. Edit: opened #3686, let's continue there. |
Add a
Test Dockerfile
job to Travis.The new job:
docker build
succeeds